<template>
  <div>
    demo1 count:{{ state.count }}| double:{{ state.double }}
    <button type="button" @click="increment">增加</button>
  </div>
</template>
<script setup lang="ts">
import { reactive, computed } from "vue";
type DState = {
  count: number;
  double: number;
};
const state: DState = reactive({
  count: 1,
  double: computed((): number => state.count * 2),
});
const increment = (): void => {
  state.count++;
};
</script>
<style scoped></style>
